from wcs.libs.players import players
from wcs.libs.items import items

itemName = 'Helmet of Excellence'
item = items.addItem(itemName)
item.setGroup("defense")
item.setCost(4000)
item.setDescription("This helmet grants you an additional 200 armor")
item.aliveToUse = True
item.setMaxCount(2)
        
def wcs_item_bought(event_var):
    """
    Executed when a player buys an item, if the player has this item active, add
    200 armor to the player's current armor
    """
    if event_var['item'] == itemName:
        userid = event_var["userid"]
        player = players[userid]
        player.armorAdd(200)